package org.maylove.wuziqi.pojo.discuss.discussBody;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

import java.time.LocalDateTime;

@Table(name = "discuss_body")
@Entity
public class DiscussBody {
    @Id
    @Column(name = "discuss_body_id")
    Long discussBodyId;
    @Column(name = "user_id")
    Long userId;
    @Column(name = "discuss_id")
    Long discussId;
    @Column(name = "time")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime time;
    @Column(name = "content")
    String content;




    public DiscussBody() {
    }

    public DiscussBody(Long discussBodyId, Long userId, Long discussId, LocalDateTime time, String content) {
        this.discussBodyId = discussBodyId;
        this.userId = userId;
        this.discussId = discussId;
        this.time = time;
        this.content = content;
    }

    public Long getDiscussBodyId() {
        return discussBodyId;
    }

    public void setDiscussBodyId(Long discussBodyId) {
        this.discussBodyId = discussBodyId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getDiscussId() {
        return discussId;
    }

    public void setDiscussId(Long discussId) {
        this.discussId = discussId;
    }

    public LocalDateTime getTime() {
        return time;
    }

    public void setTime(LocalDateTime time) {
        this.time = time;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
